<!doctype html>
<html lang="en" class="fixed sidebar-left-collapsed" xmlns:th="http://www.thymeleaf.org">
	<head>

		<!-- Basic -->
		<meta charset="UTF-8">

		<title>个人资料</title>

		<!-- Web Fonts  -->
		<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800|Shadows+Into+Light" rel="stylesheet" type="text/css">

		<!-- Vendor CSS -->
		<link rel="stylesheet" th:href="@{/vendor/bootstrap/css/bootstrap.css}" />
		<link rel="stylesheet" th:href="@{/vendor/font-awesome/css/font-awesome.css}" />
		<link rel="stylesheet" th:href="@{/vendor/magnific-popup/magnific-popup.css}" />
		<link rel="stylesheet" th:href="@{/vendor/bootstrap-datepicker/css/datepicker3.css}" />

		<!-- Theme CSS -->
		<link rel="stylesheet" th:href="@{/stylesheets/theme.css}" />

		<!-- Skin CSS -->
		<link rel="stylesheet" th:href="@{/stylesheets/skins/default.css}" />

		<!-- Theme Custom CSS -->
		<link rel="stylesheet" th:href="@{/stylesheets/theme-custom.css}">

		<!-- Head Libs -->
		<script th:src="@{/vendor/modernizr/modernizr.js}"></script>

	</head>
	<body>
		<section class="body">

			<!-- 头部 -->
			<div th:replace="~{commons/commons::header}"></div>

			<div class="inner-wrapper">
				<!-- 左侧边栏 -->
				<div th:replace="~{commons/commons::sidebar-admin}"></div>

				<!-- 主体 -->
				<section role="main" class="content-body">
					<header class="page-header">
						<h2>个人资料</h2>
					
						<div class="right-wrapper pull-right">
							<ol class="breadcrumbs">
								<li>
									<a th:href="@{/}">
										<i class="fa fa-home"></i>
									</a>
								</li>
								<li><span>信息</span></li>
								<li><span>个人资料</span></li>
							</ol>
					
							<a class="sidebar-right-toggle" data-open="sidebar-right"><i class="fa fa-chevron-left"></i></a>
						</div>
					</header>

					<!-- start: page -->

					<div class="row">
						<div class="col-md-4 col-lg-3">

							<section class="panel">
								<div class="panel-body">
									<div th:if="${session.level.trim().equals('管理员') || session.level.trim().equals('超级管理员')}" class="thumb-info mb-md">
										<img src="/static/images/!logged-user.jpg" class="rounded img-responsive" th:alt="${session.object.getName()}">
										<div class="thumb-info-title">
											<span class="thumb-info-inner" th:text="${session.object.getName()}"></span>
											<span class="thumb-info-type" th:text="${session.level}"></span>
										</div>
									</div>

									<div th:if="${session.level.trim().equals('学员') || session.level.trim().equals('教练')}" class="thumb-info mb-md">
										<img src="/static/images/!logged-user.jpg" class="rounded img-responsive" th:alt="${session.user.getName()}">
										<div class="thumb-info-title">
											<span class="thumb-info-inner" th:text="${session.user.getName()}"></span>
											<span class="thumb-info-type" th:text="${session.level}"></span>
										</div>
									</div>

									<hr class="dotted short">

									<h6 class="text-muted">Welcome</h6>
									<p>欢迎</p>
									<div class="clearfix">
										<a class="text-uppercase text-muted pull-right" href="#">(End)</a>
									</div>

									<hr class="dotted short">

								</div>
							</section>


						</div>
						<div class="col-md-8 col-lg-6">

							<div class="tabs" th:if="${session.level.trim().equals('管理员') || session.level.trim().equals('超级管理员')}">
								<ul class="nav nav-tabs tabs-primary">
									<li>
										<a href="#admin" data-toggle="tab">查看</a>
									</li>
									<li class="active">
										<a href="#editAdmin" data-toggle="tab">编辑</a>
									</li>
								</ul>

								<div class="tab-content">
									<div id="admin" class="tab-pane">
										<h4 class="mb-md">查看个人信息</h4>

										<div class="form-group">
											<label class="col-md-3 control-label" for="_adminId">账号</label>
											<div class="col-md-6">
												<input type="text" th:value="${session.object.getAdminId()}" id="_adminId" class="form-control" readonly="readonly">
											</div>
										</div>

										<div class="form-group">
											<label class="col-md-3 control-label" for="_sex">性别</label>
											<div class="col-md-6">
												<input type="text" th:value="${(session.object.getSex()==0)?'女':'男'}" id="_sex" class="form-control" readonly="readonly">
											</div>
										</div>

										<div class="form-group">
											<label class="col-md-3 control-label" for="_phone">手机号</label>
											<div class="col-md-6">
												<input type="text" th:value="${session.object.getPhone()}" id="_phone" class="form-control" readonly="readonly">
											</div>
										</div>

										<div class="form-group">
											<label class="col-md-3 control-label" for="_card">身份证号</label>
											<div class="col-md-6">
												<input type="text" th:value="${session.object.getCard()}" id="_card" class="form-control" readonly="readonly">
											</div>
										</div>

										<div class="form-group">
											<label class="col-md-3 control-label" for="_address">家庭住址</label>
											<div class="col-md-6">
												<input type="text" th:value="${session.object.getAddress()}" id="_address" class="form-control" readonly="readonly">
											</div>
										</div>

									</div>

									<div id="editAdmin" class="tab-pane active">

										<form th:action="@{/editAdminProfile}" class="form-horizontal" method="post">
											<h4 class="mb-xlg">修改个人信息</h4>
											<fieldset>
												<input type="hidden" th:value="${session.object.getAdminId()}" name="adminId">
												<div class="form-group">
													<label class="col-md-3 control-label" for="name">姓名</label>
													<div class="col-md-8">
														<input type="text" th:value="${session.object.getName()}" class="form-control" name="name" id="name">
													</div>
												</div>
												<div class="form-group">
													<label class="col-sm-3 control-label">性别</label>
													<div class="col-sm-9">
														<div class="radio-custom radio-primary" style="display: inline;">
															<input id="sex_1" name="sex" type="radio" value="1" th:checked="${session.object.getSex() == 1}"/>
															<label for="sex_1">男</label>
														</div>
														<div class="radio-custom radio-primary" style="display: inline;">
															<input id="sex_0" name="sex" type="radio" value="0" th:checked="${session.object.getSex() == 0}" />
															<label for="sex_0">女</label>
														</div>
													</div>
												</div>
												<div class="form-group">
													<label class="col-md-3 control-label" for="card">身份证号</label>
													<div class="col-md-8">
														<input type="text" th:value="${session.object.getCard()}" class="form-control" name="card" id="card">
													</div>
												</div>
												<div class="form-group">
													<label class="col-md-3 control-label" for="phone">手机号</label>
													<div class="col-md-8">
														<input type="text" th:value="${session.object.getPhone()}" class="form-control" name="phone" id="phone">
													</div>
												</div>
												<div class="form-group">
													<label class="col-md-3 control-label" for="address">家庭住址</label>
													<div class="col-md-8">
														<input type="text" th:value="${session.object.getAddress()}" class="form-control" name="address" id="address">
													</div>
												</div>
												<div class="form-group">
													<label class="col-md-3 control-label"></label>
													<div class="col-md-8">
														<p style="color:red;font-size: large;" th:text="${msg}"></p>
													</div>
												</div>
											</fieldset>
											<hr class="dotted tall">
											<h4 class="mb-xlg">修改密码</h4>
											<fieldset class="mb-xl">
												<div class="form-group">
													<label class="col-md-3 control-label" for="oldPwd">旧密码</label>
													<div class="col-md-8">
														<input type="password" class="form-control" name="oldPwd" id="oldPwd" th:value="${oldPwd}">
													</div>
												</div>
												<div class="form-group">
													<label class="col-md-3 control-label" for="newPwd">新密码</label>
													<div class="col-md-8">
														<input type="password" class="form-control" name="newPwd" id="newPwd" th:value="${newPwd}">
													</div>
												</div>
												<div class="form-group">
													<label class="col-md-3 control-label" for="newPwdRepeat">确认密码</label>
													<div class="col-md-8">
														<input type="password" class="form-control" name="newPwdRepeat" id="newPwdRepeat" th:value="${newPwdRepeat}">
													</div>
												</div>
												<div class="form-group">
													<label class="col-md-3 control-label"></label>
													<div class="col-md-8">
														<p style="color:red;" th:text="${msgPwd}"></p>
													</div>
												</div>
											</fieldset>
											<div class="panel-footer">
												<div class="row">
													<div class="col-md-9 col-md-offset-3">
														<button type="submit" class="btn btn-primary">确认修改</button>
														<button type="reset" class="btn btn-default">重置</button>
													</div>
												</div>
											</div>

										</form>

									</div>
								</div>

							</div>

							<div class="tabs" th:if="${session.level.trim().equals('学员') || session.level.trim().equals('教练')}">
								<ul class="nav nav-tabs tabs-primary">
									<li>
										<a href="#user" data-toggle="tab">查看</a>
									</li>
									<li class="active">
										<a href="#editUser" data-toggle="tab">编辑</a>
									</li>
								</ul>

								<div class="tab-content">
									<div id="user" class="tab-pane">
										<h4 class="mb-md">查看个人信息</h4>

										<div class="form-group">
											<label class="col-md-3 control-label" for="_userId_">账号</label>
											<div class="col-md-6">
												<input type="text" th:value="${session.user.getUserId()}" id="_userId_" class="form-control" readonly="readonly">
											</div>
										</div>

										<div class="form-group">
											<label class="col-md-3 control-label" for="_sex_">性别</label>
											<div class="col-md-6">
												<input type="text" th:value="${(session.user.getSex()==0)?'女':'男'}" id="_sex_" class="form-control" readonly="readonly">
											</div>
										</div>

										<div class="form-group">
											<label class="col-md-3 control-label" for="_phone_">手机号</label>
											<div class="col-md-6">
												<input type="text" th:value="${session.user.getPhone()}" id="_phone_" class="form-control" readonly="readonly">
											</div>
										</div>

										<div class="form-group">
											<label class="col-md-3 control-label" for="_card_">身份证号</label>
											<div class="col-md-6">
												<input type="text" th:value="${session.user.getCard()}" id="_card_" class="form-control" readonly="readonly">
											</div>
										</div>

										<div th:if="${session.level.trim().equals('教练')}" class="form-group">
											<label class="col-md-3 control-label" for="_subject_">教授科目</label>
											<div class="col-md-6">
												<input type="text" th:value="${session.user.getSubjectId()}" id="_subject_" class="form-control" readonly="readonly">
											</div>
										</div>

										<div class="form-group">
											<label th:if="${session.level.trim().equals('教练')}" class="col-md-3 control-label" for="_parent_">教授的车型</label>
											<label th:if="${session.level.trim().equals('学员')}" class="col-md-3 control-label" for="_parent_">学习的车型</label>
											<div class="col-md-6">
												<input type="text" th:value="${session.user.getParent()}" id="_parent_" class="form-control" readonly="readonly">
											</div>
										</div>

									</div>

									<div id="editUser" class="tab-pane active">

										<form th:action="@{/editUserProfile}" class="form-horizontal" method="post">
											<h4 class="mb-xlg">修改个人信息</h4>
											<fieldset>
												<input type="hidden" th:value="${session.user.getUserId()}" name="userId">
												<div class="form-group">
													<label class="col-md-3 control-label" for="name_user">姓名</label>
													<div class="col-md-8">
														<input type="text" th:value="${session.user.getName()}" class="form-control" name="name" id="name_user">
													</div>
												</div>
												<div class="form-group">
													<label class="col-sm-3 control-label">性别</label>
													<div class="col-sm-9">
														<div class="radio-custom radio-primary" style="display: inline;">
															<input id="sex_user_1" name="sex" type="radio" value="1" th:checked="${session.user.getSex() == 1}"/>
															<label for="sex_user_1">男</label>
														</div>
														<div class="radio-custom radio-primary" style="display: inline;">
															<input id="sex_user_0" name="sex" type="radio" value="0" th:checked="${session.user.getSex() == 0}" />
															<label for="sex_user_0">女</label>
														</div>
													</div>
												</div>
												<div class="form-group">
													<label class="col-md-3 control-label" for="card_user">身份证号</label>
													<div class="col-md-8">
														<input type="text" th:value="${session.user.getCard()}" class="form-control" name="card" id="card_user">
													</div>
												</div>
												<div class="form-group">
													<label class="col-md-3 control-label" for="phone_user">手机号</label>
													<div class="col-md-8">
														<input type="text" th:value="${session.user.getPhone()}" class="form-control" name="phone" id="phone_user">
													</div>
												</div>
												<div th:if="${session.level.trim().equals('教练')}" class="form-group">
													<label class="col-md-3 control-label" for="subject_user">教授科目</label>
													<div class="col-md-8">
														<select class="form-control mb-md" name="subjectId" id="subject_user" >
															<option th:selected="${'t2103200002'.equals(session.user.getSubjectId())}" th:text="科目二" th:value="t2103200002"></option>
															<option th:selected="${'t2103200003'.equals(session.user.getSubjectId())}" th:text="科目三" th:value="t2103200003"></option>
														</select>
													</div>
												</div>
												<div class="form-group">
													<label th:if="${session.level.trim().equals('教练')}" class="col-md-3 control-label" for="parent_user">教授的车型</label>
													<label th:if="${session.level.trim().equals('学员')}" class="col-md-3 control-label" for="parent_user">学习的车型</label>
													<div class="col-md-6">
														<select class="form-control mb-md" name="parent" id="parent_user">
															<option th:selected="${'A1'.equals(session.user.getParent())}" value="A1">A1:大型客车和A3、B1、B2</option>
															<option th:selected="${'A2'.equals(session.user.getParent())}" value="A2">A2:牵引车和B1、B2</option>
															<option th:selected="${'A3'.equals(session.user.getParent())}" value="A3">A3:城市公交车和C1</option>
															<option th:selected="${'B1'.equals(session.user.getParent())}" value="B1">B1:中型客车和C1、M</option>
															<option th:selected="${'B2'.equals(session.user.getParent())}" value="B2">B2:大型货车和C1、M</option>
															<option th:selected="${'C1'.equals(session.user.getParent())}" value="C1">C1:小型汽车和C2、C3</option>
															<option th:selected="${'C2'.equals(session.user.getParent())}" value="C2">C2:小型自动挡汽车</option>
															<option th:selected="${'C3'.equals(session.user.getParent())}" value="C3">C3:低速载货汽车和C4</option>
															<option th:selected="${'C4'.equals(session.user.getParent())}" value="C4">C4:三轮汽车</option>
															<option th:selected="${'C5'.equals(session.user.getParent())}" value="C5">C5:残疾人专用小型自动挡载客汽车</option>
															<option th:selected="${'D'.equals(session.user.getParent())}" value="D">D:普通三轮摩托车和E</option>
															<option th:selected="${'E'.equals(session.user.getParent())}" value="E">E:普通二轮摩托车和F</option>
															<option th:selected="${'F'.equals(session.user.getParent())}" value="F">F:轻便摩托车</option>
															<option th:selected="${'M'.equals(session.user.getParent())}" value="M">M:轮式自行机械车</option>
															<option th:selected="${'N'.equals(session.user.getParent())}" value="N">N:无轨电车</option>
															<option th:selected="${'P'.equals(session.user.getParent())}" value="P">P:有轨电车</option>
														</select>
													</div>
												</div>
												<div class="form-group">
													<label class="col-md-3 control-label"></label>
													<div class="col-md-8">
														<p style="color:red;font-size: large;" th:text="${msg}"></p>
													</div>
												</div>
											</fieldset>
											<hr class="dotted tall">
											<h4 class="mb-xlg">修改密码</h4>
											<fieldset class="mb-xl">
												<div class="form-group">
													<label class="col-md-3 control-label" for="oldPwd_user">旧密码</label>
													<div class="col-md-8">
														<input type="password" class="form-control" name="oldPwd" id="oldPwd_user" th:value="${oldPwd}">
													</div>
												</div>
												<div class="form-group">
													<label class="col-md-3 control-label" for="newPwd_user">新密码</label>
													<div class="col-md-8">
														<input type="password" class="form-control" name="newPwd" id="newPwd_user" th:value="${newPwd}">
													</div>
												</div>
												<div class="form-group">
													<label class="col-md-3 control-label" for="newPwdRepeat_user">确认密码</label>
													<div class="col-md-8">
														<input type="password" class="form-control" name="newPwdRepeat" id="newPwdRepeat_user" th:value="${newPwdRepeat}">
													</div>
												</div>
												<div class="form-group">
													<label class="col-md-3 control-label"></label>
													<div class="col-md-8">
														<p style="color:red;" th:text="${msgPwd}"></p>
													</div>
												</div>
											</fieldset>
											<div class="panel-footer">
												<div class="row">
													<div class="col-md-9 col-md-offset-3">
														<button type="submit" class="btn btn-primary">确认修改</button>
														<button type="reset" class="btn btn-default">重置</button>
													</div>
												</div>
											</div>

										</form>

									</div>
								</div>

							</div>

						</div>

					</div>
					<!-- end: page -->
				</section>
			</div>

			<!-- 右侧边栏 -->
			<div th:replace="~{commons/commons::sidebar-right}"></div>
		</section>

		<!-- Vendor -->
		<script th:src="@{vendor/jquery/jquery.js}"></script>
		<script th:src="@{vendor/jquery-browser-mobile/jquery.browser.mobile.js}"></script>
		<script th:src="@{/vendor/bootstrap/js/bootstrap.js}"></script>
		<script th:src="@{vendor/nanoscroller/nanoscroller.js}"></script>
		<script th:src="@{vendor/bootstrap-datepicker/js/bootstrap-datepicker.js}"></script>
		<script th:src="@{vendor/magnific-popup/magnific-popup.js}"></script>
		<script th:src="@{vendor/jquery-placeholder/jquery.placeholder.js}"></script>
		
		<!-- Specific Page Vendor -->
		<script th:src="@{/vendor/jquery-autosize/jquery.autosize.js}"></script>

		<!-- Theme Base, Components and Settings -->
		<script th:src="@{/javascripts/theme.js}"></script>

		<!-- Theme Custom -->
		<script th:src="@{/javascripts/theme.custom.js}"></script>

		<!-- Theme Initialization Files -->
		<script th:src="@{/javascripts/theme.init.js}"></script>

	</body>
</html>